import { getFormDataFieldsValue } from '@supplier/utils';
// 单据状态选择list
const STATUS_OPTIONS = [
  { value: 10, label: '待审批' },
  { value: 20, label: '审批通过' },
  { value: 30, label: '审批驳回' },
  { value: 40, label: '撤回' },
]
const FORM_ITEM_LIST = [
  {
    prop: 'billStatus',
    label: '审核状态',
    type: 'select',
    clearable: true,
    options: STATUS_OPTIONS
  },
  {
    prop: 'createUser',
    label: '提交人',
    type: 'input'
  },
  {
    prop: 'createDepartmentName',
    label: '提交人部门',
    type: 'input'
  },
  {
    prop: 'billNumber',
    label: '单据号',
    type: 'input'
  },
]
const FORM_DATA = getFormDataFieldsValue(FORM_ITEM_LIST)
// 表头
const TABLE_COLUMNS = [
  {
    title: '单据号',
    key: 'billNumber'
  },
  {
    title: '提交人',
    key: 'createUser',
  },
  {
    title: '提交部门',
    key: 'createDepartmentName',
  },
  {
    title: '提交时间',
    key: 'createTime',
  },
  {
    title: '单据状态',
    key: 'billStatusName',
  },
]

// 详情表头
const VIEW_TABLE_COLUMNS = [
  {
    title: '管理区域',
    key: 'managementAreaName'
  },
  {
    title: '归属中心',
    key: 'belongDepartmentName',
  },
  {
    title: '供应商代码',
    key: 'supplierCode',
  },
  {
    title: '供应商名称',
    key: 'supplierName',
  },
  {
    title: '公司业务对接人',
    key: 'businessContactName',
    width: 110
  },
  {
    title: '创建时间',
    key: 'supplierCreateTime',
  },
  {
    title: '供应商分类',
    key: 'supplierClassifyName',
  },
  {
    title: '供应商类型',
    key: 'supplierTypeName',
  },
  {
    title: '供应商性质',
    key: 'supplierNatureName',
  },
  {
    title: '供应商等级',
    key: 'supplierLevelName',
  },
  {
    title: '主营品类代码',
    key: 'mainCategoryCode',
  },
  {
    title: '主营品类名称',
    key: 'mainCategory',
  },
  {
    title: '合同类型',
    key: 'contractTypeNameOld',
  },
  {
    title: '本年合同签订情况',
    key: 'contract',
    children: [
      {
        title: '合同开始时间',
        key: 'contractStartTimeOld',
      },
      {
        title: '合同结束时间',
        key: 'contractEndTimeOld',
      },
      {
        title: '合同签订年度',
        key: 'contractYear',
      },
    ]
  },
  {
    title: '签订要求',
    key: 'signingRequirementName',
  },
  {
    title: '最晚完成时间',
    key: 'latestCompletionTime',
  },
  {
    title: '计划签订类型',
    key: 'signingTypeName',
  },
  {
    title: '不签订合同审批',
    key: 'notContractApprovalStatusName',
    width: 110
  },
  {
    title: '不签订合同原因',
    key: 'notContractReasonTypeName',
    width: 140
  },
  {
    title: '其它原因说明',
    key: 'notContractReason',
    width: 110
  },
  {
    title: '合同是否达标',
    key: 'contractStandardName',
  },
  {
    title: '未达标原因',
    key: 'standardReason',
  },
  {
    title: '续签/新签完成状态',
    key: 'signing',
    children: [
      {
        title: '签订情况',
        key: 'signingConditionName',
      },
      {
        title: '合同类型',
        key: 'contractTypeName',
      },
      {
        title: '合同开始时间',
        key: 'contractStartTime',
      },
      {
        title: '合同结束时间',
        key: 'contractEndTime',
      },
    ]
  },
]

export {
  FORM_ITEM_LIST,
  FORM_DATA,
  TABLE_COLUMNS,
  VIEW_TABLE_COLUMNS
}
